﻿<%@ Page Title="Roles" Language="C#" MasterPageFile="~/SysAdmin/MasterPage_SysAdmin.master" AutoEventWireup="true" CodeBehind="RolesCreator.aspx.cs" Inherits="Ones.SysAdmin.RolesCreator" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cphHead" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphMain" runat="server">
    <div class="row" >
        <div class="col-md-12">
            <div class="alert alert-success fade in" id="successtMsg" runat="server">
                <button type="button" class="close close-sm" data-dismiss="alert">
                    <i class="icon-remove"></i>
                </button>
                <strong>Role is added !</strong> You successfully add a new role to database.
            </div>
            <div class="alert alert-block alert-danger fade in" id="warningMsg" runat="server">
                <button type="button" class="close close-sm" data-dismiss="alert">
                    <i class="icon-remove"></i>
                </button>
                <strong>Role is not added !</strong> Change the role name (role name must be more than 3 letters and not exist in database) and try to add again.
            </div>
        </div>
    </div>



    <div class="row">
        <div class="col-lg-12">
            <div class="widget">
                <div class="widget-header">
                    <i class="icon-table"></i>
                    <h3>
                        Roles
                    </h3>
                    <div class="dataTables_filter" id="example_filter">
                        <label>
                            Search:&nbsp;
                        </label>
                        <input type="text" style="height: 40px; margin-top: 10px; margin-right: 7px;" aria-controls="example">
                    </div>
                </div>
                <div class="widget-content">
                    <div class="example_alt_pagination">
                        <div id="container">
                            <div class="full_width big">
                            </div>
                            <div id="demo">
                                <!--------- CONTENT TABLE ------------->
                                <asp:Repeater ID="roleList" runat="server"
                                    OnItemCommand="roleList_ItemCommand">
                                    <HeaderTemplate>
                                        <table cellpadding="0" cellspacing="0" class="display data-table">
                                            <thead>
                                                <tr>
                                                    
                                                    <th>
                                                        Role Name
                                                    </th>
                                                    <th>
                                                        Role ID
                                                    </th>
                                                    <th>
                                                        Description
                                                    </th>
                                                   <th></th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <tr class='<%#Container.ItemIndex % 2 == 0 ? "gradeA odd" : "gradeA even" %>'>
                                            
                                            <td>
                                                <%#DataBinder.Eval(Container.DataItem, "RoleName") %>
                                            </td>
                                            <td>
                                                <%#DataBinder.Eval(Container.DataItem, "RoleId") %>
                                            </td>
                                            <td>
                                                <%#DataBinder.Eval(Container.DataItem, "Description") %>
                                            </td>
                                            <td class="hidden-xs">
                                                <asp:Button class="btn btn-sm btn-primary" runat="server" Text="Modify" CommandName="modify" CommandArgument='<%#DataBinder.Eval(Container.DataItem, "RoleId") %>' UseSubmitBehavior="false"/>
                                            </td>
                                        </tr>
                                    </ItemTemplate>
                                    <FooterTemplate>
                                        </tbody> </table>
                                    </FooterTemplate>
                                </asp:Repeater><%--
                                <div class="clearfix">
                                    <div class="pull-right">
                                    </div>
                                    <ul class="pagination no-margin">
                                        <li class="disabled"><a href="#">Prev</a> </li>
                                        <li class="active"><a href="#">1</a> </li>
                                        <li><a href="#">2</a> </li>
                                        <li><a href="#">3</a> </li>
                                        <li><a href="#">Next</a> </li>
                                    </ul>
                                </div>--%>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>



    <div class="row">
        <div class="col-md-12">
            <div class="widget">
                <div class="widget-header">
                    <i class="icon-arrow-down"></i>
                    <h3>
                        <b>Role Creator</b>
                    </h3>
                </div>
                <div class="widget-content">
                    <form id="frmAds" method="post" class="form-horizontal validate-needed-form required">
                    <fieldset>
                        <legend class="section">Role Info </legend>
                        <div class="control-group">
                            <div class="col-md-3">
                                <label for="hint-field" class="control-label">
                                    Role name
                                </label>
                            </div>
                            <div class="col-md-9">
                                <div class="form-group">
                                    <asp:TextBox runat="server" ID="txtRoleName" placeholder="enter role name here..."
                                        data-type="dateIso" class="form-control parsley-validated required"></asp:TextBox>
                                </div>
                            </div>
                        </div>
                    </fieldset>
                    <div class="form-actions">
                        <div>
                            <asp:Button class="btn btn-success" Text="Create Role" runat="server" OnClick="CreateRole_Click" />
                            <button class="btn btn-default" type="button">
                                Cancel
                            </button>
                        </div>
                    </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cphScript" runat="server">
</asp:Content>
